package br.com.sigupper.entidades;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import br.com.sigupper.util.IGenericCrud;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="cliente")
public abstract class Cliente  implements IGenericCrud {
	@Id
	@GeneratedValue
    private Integer clienteId;
    
	@ManyToOne
	@JoinColumn(name="endereco_id",nullable=false)
	private Endereco endereco;
    
	@Column(name="cliente_dt_cadastro",nullable=false)
	private Date clienteDtCadastro;
	
	@Column(name="cliente_email",length=150)
    private String clienteEmail;
	
	
	@ManyToMany
	@JoinTable(name="cliente_telefone",
			joinColumns=@JoinColumn(name="cliente_id"),
			inverseJoinColumns=@JoinColumn(name="telefone"))
    private  List<Telefone> telefones= new ArrayList<Telefone>();

	public Cliente() {
		// TODO Auto-generated constructor stub
	}
    
    public Integer getClienteId() {
        return this.clienteId;
    }
    
    public void setClienteId(Integer clienteId) {
        this.clienteId = clienteId;
    }

    public Endereco getEndereco() {
        return this.endereco;
    }
    
    public void setEndereco(Endereco endereco) {
        this.endereco = endereco;
    }

    public Date getClienteDtCadastro() {
        return this.clienteDtCadastro;
    }
    
    public void setClienteDtCadastro(Date clienteDtCadastro) {
        this.clienteDtCadastro = clienteDtCadastro;
    }

    public String getClienteEmail() {
        return this.clienteEmail;
    }
    
    public void setClienteEmail(String clienteEmail) {
        this.clienteEmail = clienteEmail;
    }

	public List<Telefone> getTelefones() {
		return telefones;
	}

	public void setTelefones(List<Telefone> telefones) {
		this.telefones = telefones;
	}

   
   
}